<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateNationRechargeBagTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('nation_recharge_bag', function (Blueprint $table) {
            $table->increments('id');//自增id
            $table->integer('user_id')->comment('用户id');
            $table->tinyInteger('rank')->default(1)->comment('充值等级 1 600 2 3000 3 9800');
            $table->string('gift_log',500)->default('')->comment('领取记录json记录');
            $table->tinyInteger('status')->default(0)->comment('0未领取 1已领取');
            $table->timestamp('created_at')->default(\Illuminate\Support\Facades\DB::raw("CURRENT_TIMESTAMP"))->comment('创建时间');
            $table->index(['user_id']);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('nation_recharge_bag');
    }
}
